const { Readable } = require('stream');

class MyReadable extends Readable {
  constructor(options) {
    super(options);
    this.currentCharCode = 97; // 'a'的ASCII码
    this.endCharCode = 122;    // 'z'的ASCII码
  }

  _read() {
    if (this.currentCharCode > this.endCharCode) {
      this.push(null); // 结束流
    } else {
      const buf = Buffer.from(String.fromCharCode(this.currentCharCode));
      this.push(buf);
      this.currentCharCode++;
    }
  }
}

// 创建实例并输出到stdout
const myStream = new MyReadable();
myStream.pipe(process.stdout);